﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using University.Workshop.Presenters;

namespace University.Workshop.WinApp.AmbulanceFolder
{
    public partial class AmbulanceListView : Form, IAmbulance
    {
        AmbulancePresenter presenter;

        public AmbulanceListView()
        {
            InitializeComponent();
            presenter = new AmbulancePresenter(this);
            dataGridView1.DataSource = AmbulancePresenter.AmbulanceSearch();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (AmbulancePresenter.AmbulanceExists(textBox1.Text) == false)
                MessageBox.Show("La placa no existe");
            else
            {
                ModifyAmbulanceView modifyAmbulance = new ModifyAmbulanceView(textBox1.Text);
                modifyAmbulance.Show();
            }
        }

        public string AmbulanceId
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string Model
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string Year
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string PurchaseYear
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

       
        private void button3_Click(object sender, EventArgs e)
        {
            this.Close();
        }


        public string State
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }


        public string Deleted
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (AmbulancePresenter.AmbulanceExists(textBox1.Text) == false)
                MessageBox.Show("La placa no existe");
            else
            {
                MessageBox.Show(AmbulancePresenter.DeleteAmbulance(textBox1.Text));
                dataGridView1.Refresh();
                this.Close();
            }
        }
    }
}
